<?php
/**
 * @package Curly
 * @version 0.9
 * @link http://curly.codeplex.com/
 * @license http://curly.codeplex.com/license The MIT License
 * @author Dawid Zawada
 */

namespace Curly
{
    /**
     * Simple class representing communication error
     * 
     * @package Curly
     * @license http://curly.codeplex.com/license The MIT License
     */
    class Error
    {
        /**
         * Error code
         * 
         * @var int
         */
        protected $code;
        
        /**
         * Error message
         * 
         * @var string
         */
        protected $message;
        
        /**
         * Creates a new Error object
         * 
         * @internal
         * @param string $message
         * @param int $code [optional]
         */
        public function __construct( $message, $code = null )
        {
            $this->message = $message;
            $this->code = $code;
        }
        
        /**
         * Returns the error code
         *
         * @return int
         */
        public function getCode()
        {
            return $this->code;
        }
        
        /**
         * Returns the error message
         *
         * @return string
         */
        public function getMessage()
        {
            return $this->message;
        }
    }
}